package com.yangrong.thread.chapter6;

/**
 * ReadWriteLock design pattern
 * Reader-Writer design pattern
 * 
 * @author YangRong
 * @date 2020年6月8日
 */
public class ReadWriteLockClient {

	public static void main(String[] args) {
		final SharedDate sharedDate = new SharedDate(10);
		new ReaderWorker(sharedDate).start();
		new ReaderWorker(sharedDate).start();
		new ReaderWorker(sharedDate).start();
		new ReaderWorker(sharedDate).start();
		new ReaderWorker(sharedDate).start();

		new WriterWorker(sharedDate, "abcdefghijklmn").start();
		new WriterWorker(sharedDate, "ABCDEFGHIJKLMN").start();
	}

}
